home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1995 November / EnigmA AMIGA RUN 02 (1995)(G.R. Edizioni)(IT)[!][issue 1995-11][Skylink CD].iso / earcd / misc / savename.lha / SaveNames1.3 / SaveNames.man < prev    next >
Text File  |  1995-09-30  |  15KB  |  280 lines

  1.  
  2.  
  3.  NNNNAAAAMMMMEEEE  -  SaveNames 1.3
  4.  
  5.  
  6.  _C_o_p_y_r_i_g_h_t_ _(_w_h_y_ _n_o_t_._._._)
  7.  
  8.  SSSSaaaavvvveeeeNNNNaaaammmmeeeessss    vvvv1111....1222 software and documentation are copyrighted © 1995 by
  9.  MMMMaaaarrrrcccciiiinnnn    OOOOrrrrlllloooowwwwsssskkkkiiii. All Rights Reserved.
  10.  
  11.  
  12.  _D_i_s_t_r_i_b_u_t_i_o_n_ _(_p_i_r_a_t_e_ _o_r_ _d_i_e_!_)
  13.  
  14.  Freely distributable in complete archive with following files included:
  15.  
  16.  SaveNames.c         - source code
  17.  SaveNames.c.info    - source icon
  18.  SaveNames.doc       - this documentation
  19.  SaveNames.doc.info  - documentation icon
  20.  SaveNames.man       - this documentation in UNIX's man format
  21.  SaveNames           - AAAAmmmmiiiiggggaaaa executable
  22.  SaveNames.info      - AAAAmmmmiiiiggggaaaa executable icon
  23.  SD!.displayme       - our BBS info
  24.  
  25.  
  26.  _D_i_s_c_l_a_i_m_e_r_ _(_a_s_ _a_l_w_a_y_s_ _:_)
  27.  
  28.  No responsibility or liability will be accepted for any damage that
  29.  may appear to have resulted from use of this program. All use is at
  30.  your own risk. The software is provided "as is" without any warranty
  31.  implied or otherwise to the fitness or accuracy of the software and
  32.  documentation. The author reserves the right to update the software
  33.  and/or documentation without notice.
  34.  
  35.  
  36.  _U_s_a_g_e_ _(_w_h_a_t_ _i_s_ _i_t_!_?_)
  37.  
  38.  Some people (like me) are forced to use pee-cee machines to transfer
  39.  files from internet to my AAAAmmmmiiiiggggaaaa (it doesn't mean I've bought a pc
  40.  for my own! I use (big word:) it only at my technical university).
  41.  As you all know, no one needs more chars to name his files than 8.3,
  42.  which seems to be a 'professional filename format'. Any other, longer
  43.  names are obsolete and should be forbidden. Unfortunately both AAAAmmmmiiiiggggaaaa
  44.  and Unix based machines use longer names for their files, so
  45.  transfering files between those platforms via pc causes 90% of name
  46.  (mainly dots :) to be eaten by pc. So I decided to cure this.
  47.  SaveNames is the medicine against. What does it do? Lets say, you want
  48.  to transfer some files stored in directory _M_y_F_i_l_e_s on your Unix
  49.  account to AAAAmmmmiiiiggggaaaa via pc floppies. Files use 'obsolete' names:
  50.  
  51.                      kickstart
  52.                      KICKdisk.info
  53.                      kickstart.info
  54.  
  55.  So before you start to copy them to disk type:
  56.  
  57.                      SSSSaaaavvvveeeeNNNNaaaammmmeeeessss    CCCC    MMMMyyyyFFFFiiiilllleeeessss
  58.  
  59.  and names of all files in this directory are converted (CCCC means
  60.  CCCCOOOODDDDEEEE and may be lowercase or mixedcase) to less than 8 chars (suffix
  61.  PPPPCCCCPPPP (pc protection :) will also be added to allow you easily detect
  62.  those files, or automate decoding e.g. via _D_O_p_u_s_ _F_i_l_e_C_l_a_s_s. If you use
  63.  _D_O_p_u_s set class checking to: MMMMAAAATTTTCCCCHHHHNNNNAAAAMMMMEEEE    WWWWFFFFMMMMHHHHFFFFiiiilllleeee....iiiiddddxxxx    OOOORRRR    MMMMAAAATTTTCCCCHHHHNNNNAAAAMMMMEEEE    ####????....ppppccccpppp
  64.  and operation to ((((AAAAmmmmiiiiggggaaaaDDDDoooossss)))) SSSSaaaavvvveeeeNNNNaaaammmmeeeessss    DDDD    {{{{ssss}}}} and you will decode files
  65.  by doubleclick.). Phew, you said? No big deal? pc does it itself! Bet it
  66.  doesn't. If you look in your MMMMyyyyFFFFiiiilllleeeessss drawer you'll find the new file
  67.  named WWWWFFFFMMMMHHHHFFFFiiiilllleeee....iiiiddddxxxx looking like that:
  68.  
  69.                      7204094 kickstart
  70.                      720704c KICKdisk.info
  71.                      72085c4 kickstart.info
  72.  
  73.  Got it? Yes! Those data are used to restore filenames after whole
  74.  transfer on destination machine. How to do this? Copy transfered files
  75.  from pc disks to one directory on your Amiga disk (e.g. MMMMyyyyFFFFiiiilllleeeessssTTTToooooooo)
  76.  and type:
  77.  
  78.                      SSSSaaaavvvveeeeNNNNaaaammmmeeeessss    DDDD    MMMMyyyyFFFFiiiilllleeeessssTTTToooooooo
  79.  
  80.  This time command DDDD means DDDDeeeeccccooooddddeeee. Program opens file index
  81.  described below and renames all known (stored in index) files back
  82.  to theirs original names. Simple? Yes, it is. And it works too!
  83.  
  84.  NNNNOOOOTTTTEEEE:::: Command DDDD has special, expanded mode, activating by ----
  85.  as command prefix: ----DDDD. See _T_e_c_h_n_i_c_a_l_ _I_n_f_o chapter to find
  86.  out what this feature is for.
  87.  
  88.  While names coding SSSSaaaavvvveeeeNNNNaaaammmmeeeessss shows you estimated number of disks
  89.  you will need to store all your crypted files on. If you want
  90.  do this calculation without main code process use ----CCCC command
  91.  instead of CCCC.
  92.  
  93.  
  94.  _R_e_q_u_i_r_e_m_e_n_t_s
  95.  
  96.  Something with Intel outside, few bytes of free memory, files to eat,
  97.  2 busty babes and 1 big beer.
  98.  
  99.  
  100.  _T_e_c_h_n_i_c_a_l_ _i_n_f_o_ _(_s_o_u_n_d_s_ _s_o_o_o_o_ _w_i_s_e_._._._ _:_)
  101.  
  102.  Portability is base idea of this project, so SSSSaaaavvvveeeeNNNNaaaammmmeeeessss is written in
  103.  plain _A_N_S_I_ _C and may be simply compiled on any machine. If you find any
  104.  problems, let me know! And do not compile it on pc - it doesn't have any
  105.  sense... :)
  106.  
  107.  Unfortunately small changes, as always, have to be done before you run
  108.  the compiler, so look into the source, and select your platform (for
  109.  now AAAAMMMMIIIIGGGGAAAA, UNIX (being honest IRIX) and LINUX is checked and supported.
  110.  If you port it to Mac world let me know and send changes to me (in this
  111.  case please do only small GUI). AAAAMMMMIIIIGGGGAAAA side was tested on my AAAA4444000000000000, UNIX
  112.  platform was tested on SILICON GRAPHICS' IRIS INDIGO and HP. LINUX side
  113.  was tested on... LINUX side :-)
  114.  
  115.  Name encoding is done in two passes. 1st pass - scanning directory
  116.  and building coded names, 2nd pass renaming files and writting
  117.  index file. It has to be done this way, because scanning directory
  118.  while it is changing, may (and in 99% it does) put the program in the
  119.  infinite loop. Sometimes we may also miss some files. Decoding is done
  120.  in one pass.
  121.  
  122.  Starting to decode, program tries to read index file first. First it
  123.  tries to open file named WWWWFFFFMMMMHHHHFFFFiiiilllleeee....iiiiddddxxxx. If file couldn't be found,
  124.  it tries to open file again, with name in lowercase and if it fails
  125.  to, the last try use uppercased name. This is important mainly for
  126.  Unix side, because Unix is casesensitive. So if you transferred
  127.  your files via pc, the names may be 'fixed' to lower or uppercase.
  128.  While decoding, program may do the same trick with files to decode,
  129.  but this feature is defaulty off, which means that only one try is
  130.  attemped, and filenames are supposed to be exactly the same as while
  131.  coding. Use ----DDDD instead of DDDD to turn this on.
  132.  
  133.  You may convert as many file names as you wish, because there's no
  134.  static arrays, but dynamicaly build list. You are only limited by your
  135.  memory. To code 1000 names you will need, on AAAAmmmmiiiiggggaaaa, about 266KB. Why
  136.  only 266KB? Because every name is stored in a list's entry containing
  137.  pointer to next entry (on 32bit machines it takes 4 bytes), converted
  138.  name (12 chars + trailing zero) and original file name. The size of last
  139.  entry depends on your system. In your system includes, you will find
  140.  definition of _M_A_X_N_A_M_E_L_E_N, which limits max length of filename. On AAAAmmmmiiiiggggaaaa
  141.  it's set to 255 chars. For now it's too much, because you cannot use names
  142.  longer than 30 chars (because there's no more free bytes on disk block).
  143.  So if you are RRRREEEEAAAALLLLLLLLYYYY out of memory, you may change this by hand (see
  144.  included source). Safe value is 108, because system structure
  145.  FileInfoBlock reserves exactly 108 bytes for filename. You may save then
  146.  few bytes. E.g. for those 1000 files mentioned above, with _M_A_X_N_A_M_E_L_E_N
  147.  set to 30 you will save 248KB, with _M_A_X_N_A_M_E_L_E_N set to 108, only :) 145
  148.  KB but think what are you doing! You probably never code more than 100
  149.  names in one session and you surely do not use A1000 with 256 KB RAM. So
  150.  better leave MAXNAMELEN alone...
  151.  
  152.  You may ask: How do you code filenames to those weird numbers, pal?
  153.  I answer: I do not code it at all! I'm just copying file's own INode
  154.  (it's kind of FileHandle on Unix machines). Because all filesystems
  155.  use almost the same algorithms, it also use INodes without any tricks
  156.  (maybe pc does it different, but who cares pc?). Sometimes it is
  157.  called INode, sometimes FileHandle and sometimes BlahBlahBlah, but
  158.  it always means the same - almost unique number belongs to file.
  159.  On Amiga side I could use GetUniqueID() from utility.library, but
  160.  it is available under OS3.0 and newer and, what is more important,
  161.  generates only 4294967295 unique numbers. That's all.
  162.  
  163.  
  164.  _B_u_g_s_ _(_e_e_p_._._._)
  165.  
  166.  Program doesn't recognize if name belongs to directory or to file and
  167.  treats all the same. For now, it also can't scan directories
  168.  recursively. Solution: do not create subdirs in drawer you want
  169.  SaveNames to process.
  170.  
  171.  There may appear some problems if you will have two files in the dir,
  172.  being in fact links to other file. In this case INode will be the
  173.  same. Solution: use proper file instead of its shadows.
  174.  
  175.  You must nnnnooootttt have file named WWWWFFFFMMMMHHHHFFFFiiiilllleeee....iiiiddddxxxx in your drawer, because
  176.  while encoding/decoding it's written/read sequentially. So while
  177.  encoding it may be overwriten (but not if it is 1st file
  178.  in directory :). While decoding it will be skipped, because of
  179.  already opened (being in use) file with the same name. Solution:
  180.  rename your file :)
  181.  
  182.  On Amiga side it doesn't work when called from WB. If I find some spare
  183.  time I maybe add this, but I am not quite sure it's really needed.
  184.  
  185.  If you have transferred this archive from Unix account to your
  186.  machine via pc, you have probably noticed that few letters have been
  187.  eaten.. You should use... SaveNames to avoid it! :)
  188.  
  189.  Some older compilers requires the function to be declared in old C&R
  190.  style (see the source if you don't know what it's about). If you are
  191.  own such a compiler, simply uncommet the OOOOLLLLDDDD____SSSSTTTTYYYYLLLLEEEE definition befor
  192.  you start to compile the program.
  193.  
  194.  
  195.  _F_u_t_u_r_e_ _p_l_a_n_s_ _(_w_o_w_!_)
  196.  
  197.  If someone finds a reason to decode single files too, I will add this
  198.  feature on request, bacause it's easy to do... :)
  199.  
  200.  I also may add WB handling, but I don't think anybody needs this.
  201.  
  202.  Recursive directory scanning.
  203.  
  204.  
  205.  _H_i_s_t_o_r_y_ _(_w_h_a_t_ _h_a_s_ _h_a_p_p_e_n_ _t_o_ _t_h_e_ _S_h_e_r_l_o_c_k_ _H_o_l_m_e_s_ _i_n_ _t_h_e_ _p_a_s_t_)
  206.  
  207.   * v1.0  -  Initial release
  208.              Worldwide distribution
  209.              Begin of SaveNames-mania....
  210.  
  211.   * v1.1  -  WWWWAAAARRRRNNNNIIIINNNNGGGG: Internal format of the _W_F_M_H_F_i_l_e_._i_d_x
  212.              has been changed! Better decode all old stuff
  213.              before you install this release!
  214.  
  215.              _C_h_a_n_g_e_s_:
  216.  
  217.           -  LINUX and gcc differences and needs supported
  218.           -  Unnecessary %ld's replaced by %d's
  219.           -  SSSSaaaavvvveeeeNNNNaaaammmmeeeessss could not find the index file on Unix
  220.               side if its name was 'processed' by pc (see manual)
  221.  
  222.              Reported by _N_i_k_l_a_s_ _E_d_m_u_n_d_s_s_o_n
  223.  
  224.           -  Added old C&R function declaration for older compilers
  225.               (this feature is switchable and defaulty is off)
  226.           -  SaveNames will not remove WWWWFFFFMMMMHHHHFFFFiiiilllleeee....iiiiddddxxxx index file
  227.               if restoring was not 100% successed
  228.  
  229.              Suggested by _K_o_n_r_a_d_ _D_u_b_i_e_l.
  230.  
  231.   * v1.2  -  Expand decoding mode added (see 'Technical Info').
  232.           -  Solved problems with names contain spaces (this was
  233.               the main reason I've changed the index file format).
  234.           -  SaveNames can now calculate number of disks you will
  235.               need to store contents of your dir on floppies
  236.               (both for Amiga and pc disks) and number of bytes
  237.               left free on the last diskiette.
  238.           -  New command '-C' ('-COUNT') added, which scans given
  239.               directory and counts total length of files and
  240.               floppy disk usage (while coding, those information
  241.               will also be shown).
  242.           -  Source slightly rewritten.
  243.  
  244.   * v1.3  -  Small code improvements (it's now even more portable :-)
  245.           -  Enforcer hit removed
  246.  
  247.  
  248.  _A_u_t_h_o_r_ _(_i_t_'_s_ _m_e_,_ _i_t_'_s_ _m_e_)
  249.  
  250.  MMMMaaaarrrrcccciiiinnnn    OOOOrrrrlllloooowwwwsssskkkkiiii
  251.  ul. Radomska 38
  252.  71-002 Szczecin
  253.  Poland
  254.  
  255.  _E_-_M_a_i_l: carlos@felix.univ.szczecin.pl
  256.  
  257.  FidoNet:       Marcin Orlowski@2:481/22.2
  258.  GlobalNet:     Marcin Orlowski@52:4800/6
  259.  
  260.  
  261. --------------------- C O M M E R C I A L    B R E A K --------------------
  262.  
  263.       ______ __   __
  264.      / ____//_/  / /            Find your way to the smallest & slowest
  265.     / /___ __   / /  __  __ ______ _____
  266.    /___  // /  / /  / / / // ____// .__/   BBS in central Europe !!!
  267.   ____/ // /_ / /_ / /_/ // __/_ / /
  268.  /_____//___//___/ \____//_____//_/           WWWW....FFFF....MMMM....HHHH.... support
  269.                                                                  __
  270.                        ____       GlobalNET: 52:4800/6       __ / /
  271.   _+_4_8_ _9_1_ _5_4_0_4_3_1       / __ \        FidoNET: 2:481/22.2     / / \/
  272.                      / / / /_____ ______ ______ _   _      / /   ______
  273.  22224444    HHHHoooouuuurrrrssss    ////    DDDDaaaayyyy     / / / // .__// ____// __  // \_/ \    /_/   / ____/
  274.                    / /_/ // /   / __/_ / __  // /__/ /   __    _\__  /
  275.  1111222200000000-11119999222200000000 bps   /_____//_/   /_____//_/ /_//_/  /_/   /_/   /_____/
  276.  
  277.      Serving on AAAA3333000000000000, 2222CCCCDDDDTTTTVVVVssss, 2222AAAA555500000000++++, 5555 additional CCCCDDDD----RRRROOOOMMMMs on-line
  278.                       For all AAAAmmmmiiiiggggaaaassss, Macs and C64
  279.  
  280.